package com.changgou.goods.feign;

import com.changgou.goods.pojo.Sku;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: wzw
 * @Date: 2020/12/13 21:31
 * @version: 1.8
 */
@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {

    /***
     * 根据ID查询Sku数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Sku> findById(@PathVariable(value = "id") Long id);

    /**
     * @param status
     * @return java.util.List<com.changgou.goods.pojo.Sku>
     * @author wzw
     * 将正常状态的库存信息保存到索引库
     * @Date 21:20 2020/12/13
     **/
    @GetMapping("/findSkusByStatus/{status}")
    Result<List<Sku>> findSkusByStatus(@PathVariable(value = "status") String status);

    /**
     * @author 栗子
     * @Description 查询库存信息
     * @Date 2:06 2019/8/19
     * @param sku
     * @return entity.Result<java.util.List<com.changgou.goods.pojo.Sku>>
     **/
    @PostMapping(value = "/search" )
    Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);

}
